home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
U-Utilities
/
(c)u1.d64
/
intermod.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
3KB
|
127 lines
100 REM INTERMOD BY: WILLIAM STINSON. C64 MODS 1983 BY WIM
110 POKE53280,1:POKE53281,1:POKE53272,21:PRINT"[144][147]"
120 PRINT" INTERMODULATION DISTORTION":PRINT:PRINT
130 PRINT" THIS PROGRAM CALCULATES IM PRODUCTS
140 [153]"FOR ALL COMBINATION OF FREQUENCIES YOU
150 PRINT"INPUT. THE MAXIMUM FREQUENCIES YOU CAN
160 [153]"INPUT ARE 150.":[153]
170 [153]" THE PROGRAM WILL THEN ASK FOR THE
180 PRINT"FREQUENCIES THAT YOU WANT TO CHECK FOR
190 [153]"IM PRODUCTS. THEY CAN BE ANY FREQUENCY,
200 PRINT"EITHER IN-BAND OR OUT-OF-BAND, AND WILL
210 [153]"BE THE ONLY ONES PRINTED OUT.":[153]
220 [153]" YOU WILL THEN BE ASKED HOW CLOSE THE
230 PRINT"HARMONIC MUST BE IN ORDER TO BE
240 [153]"CONSIDERED.":[153]
250 [153]" (PUSH ANY KEY TO CONTINUE)":[153]
260 [161]A$:[139]A$[178]""[167]260
270 [153]"LOAD DO YOU WANT TO SAVE THE RESULTS. Y OR N"
280 [133]S$:[153]"ON TAPE OR DISK. T OR D":DV[178]1:[133]DV$:[139]DV$[178]"D"[167]DV[178]8
290 [139]S$[178]"Y"[167]S$[178]"SAVE":[137]310
300 [137]320
310 [153]"WHAT IS THE FILE NAME";:[133]T$:[139]DV[178]1[167][159]1,1,1,T$:[152]1,T$:[137]318
315 [159]1,8,7,T$[170]",P,W":[152]1,T$
318 [141]1330
320 [134]F(150)
330 A[178]1:P[178]0:J$[178]"**** NO HITS ****":H[178]1:J[178]150:K[178]0:L[178]2:M[178]3
340 S[178].5:B1[178]20:[134]W(40):O[178]10000
350 C1[178]40:[153]"LOADINPUT ALL FREQUENCIES TO BE CONSIDERED
360 PRINT"(IN MHZ.),(150 FREQUENCIES MAX).
370 [153]"MAKE YOUR LAST ENTRY '0'.
380 INPUTF(A):T$=STR$(F(A)):GOSUB1420:IFF(A)<>0THENA=A+H:GOTO380
390 PRINT:PRINT" PLEASE ENTER THE HARMONICS OR
400 [153]"FREQUENCIES YOU ARE INTERESTED IN
410 PRINT"(0 WHEN DONE ).
420 [129]E1[178]H[164]C1
430 [133]W(E1):T$[178][196](W(E1)):[141]1420
440 [139]W(E1)[178]K[137]460
450 [130]E1
460 [153]:[133]"WITHIN HOW MANY KHZ.";Q:T$[178][196](Q):[141]1420:Q[178]Q[172].001
470 [153]:[153]" WORKING----":[153]:TI$[178]"000000":[153]
480 [153]"FREQUENCY FN PRODUCT FN FORMULA"
490 [153]"TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB("
500 [129]B[178]H[164]J
510 [129]C[178](B[170]H)[164]J
520 [139]F(B)[178]K[167]700
530 [139]F(C)[178]K[167][130]B
540 [139]F(B)[177]F(C)[167]X[178]F(C):[137]560
550 X[178]F(C):Y[178]F(B)
560 N[178](L[172]X)[171]Y:[141]820:P7[178]1:[141]960
570 N[178](M[172]X)[171](L[172]Y):[141]820:P7[178]2:[141]960
580 N[178](L[172]Y)[171]X:[141]820:P7[178]3:[141]960
590 N[178](L[172]X)[170](M[172]Y):[141]820:P7[178]4:[141]960
600 N[178](M[172]Y)[171](L[172]X):[141]820:P7[178]5:[141]960
610 N[178](L[172]X)[171](M[172]Y):[141]820:P7[178]6:[141]960
620 N[178](L[172]X)[170]Y:[141]820:P7[178]7:[141]960
630 [129]D[178](C[170]H)[164]J
640 Z[178]F(D):[139]Z[178]0[167][130]C
650 N[178]X[170]Y[171]Z:[141]820:P7[178]8:[141]1140
660 N[178]X[170]Z[171]Y:[141]820:P7[178]9:[141]1140
670 N[178]X[170]Y[170]Z:[141]820:P7[178]10:[141]1140
680 N[178]Z[170]Y[171]X:[141]820:P7[178]11:[141]1140
690 [130]D
700 [139]P[178]H[137]750
710 [129]T1[178]1[164]20
720 [153]J$:[129]T[178]1[164]20:[130]T
730 [153]"ON";J$;"WAIT":[129]T[178]1[164]20:[130]T
740 [153]"ON";:[130]T1
750 T1$[178][200](TI$,2):T2$[178][202](TI$,3,2):T3$[178][201](TI$,2):
760 N[178]([197](T1$)[172]60)[170]([197](T2$))[170]([197](T3$)[173]60):O[178]100:[141]820
770 [153]"TOTAL TIME =";N;"MIN.":[133]"AGAIN ";Y$
780 [139][200](Y$,1)[178]"Y"[167][156]:[137]330
790 [139]S$[179][177]"SAVE"[167]810
800 [152]1,"END":[160]1
810 [128]
820 [143] ROUND TO 3 DECIMAL PLACES
830 N[178][181](N[172]O[170]S)[173]O
840 [142]
850 Y$[178]"CMD @ (2A-B)":[153]Y$:[142]
860 Y$[178]"CMD @ (3A-2B)":[153]Y$:[142]
870 Y$[178]"CMD @ (2B-A)":[153]Y$:[142]
880 Y$[178]"CMD @ (2A+3B)":[153]Y$:[142]
890 Y$[178]"CMD @ (3B-2A)":[153]Y$:[142]
900 Y$[178]"CMD @ (2A-3B)":[153]Y$:[142]
910 Y$[178]"CMD @ (2A+B)":[153]Y$:[142]
920 Y$[178]"CMD @ (A+B-C)":[153]Y$:[142]
930 Y$[178]"CMD @ (A+C-B)":[153]Y$:[142]
940 Y$[178]"CMD @ (A+B+C)":[153]Y$:[142]
950 Y$[178]"CMD @ (B+C-A)":[153]Y$:[142]
960 [143] CHECK FOR BAD HARMONIC
970 [129]D1[178]H[164]C1
980 [139]W(D1)[178]K[167]:[137]1010
990 [139]N[177](W(D1)[171]Q)[175]N[179](W(D1)[170]Q)[137]1020
1000 [130]D1
1010 [142]
1020 [143]
1030 [153]"";W(D1);"CMD <=>";N;
1040 [145]P7[141]850,860,870,880,890,900,910,920,930,940,950
1050 [153]" "X;"CMD TAN";Y:P[178]1
1060 [139]S$[179][177]"SAVE"[167]1010
1070 [152]1,W(D1):T$[178][196](W(D1)):[141]1330
1080 [152]1,N:T$[178][196](N):[141]1330
1090 [152]1,Y$:T$[178]Y$:[141]1330
1100 [152]1,X:T$[178][196](X):[141]1330
1110 [152]1,Y:T$[178][196](Y):[141]1330
1120 [152]1,Z:T$[178][196](Z):[141]1330
1130 [137]1010
1140 [143] CHECK FOR BAD HARMONIC
1150 [129]D1[178]H[164]C1
1160 [139]W(D1)[178]K[167]:[137]1190
1170 [139]N[177](W(D1)[171]Q)[175]N[179](W(D1)[170]Q)[137]1200
1180 [130]D1
1190 [142]
1200 [143]
1210 U[178][182](W(D1)[171]N)
1220 [153]"";W(D1);"CMD <=>";N;
1230 [145]P7[141]850,860,870,880,890,900,910,920,930,940,950
1240 [153]" "X;"CMD TAN";Y;"CMD TAN";Z:P[178]1
1250 [139]S$[179][177]"SAVE"[167]1190
1260 [152]1,W(D1):T$[178][196](W(D1)):[141]1330
1270 [152]1,N:T$[178][196](N):[141]1330
1280 [152]1,Y$:T$[178]Y$:[141]1330
1290 [152]1,X:T$[178][196](X):[141]1330
1300 [152]1,Y:T$[178][196](Y):[141]1330
1310 [152]1,Z:T$[178][196](Z):[141]1330
1320 [137]1190
1330 [142]